<%--
 * Título: gestHora. Aplicación web de gestión de horarios para conservatorios.
 * Alumnos:
 * - Javier Pardo Muñoz. I.T. Informática de Gestión
 * - Antonio Prior Cazorla. I.T. Informática de Gestión
 * Director: Dr. José Raúl Romero Salguero.
 *     
 *  Copyright (C) 2013 Javier Pardo Muñoz / Antonio Prior Cazorla
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.

 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
--%>

<%@page import="es.uco.gesthora.business.Noticia"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%

    String tipo = request.getParameter("tipo");

    if (tipo.equals("listarNoticias")) {

        String listado = null;
        int portada = 0;
        listado = Noticia.getInstance().listar(portada);
        out.println(listado);

    }

    else if (tipo.equals("listarNoticiasPortada")) {

        String listado = null;
        int portada = 1;
        listado = Noticia.getInstance().listar(portada);
        out.println(listado);

    }

    else if (tipo.equals("obtenerNoticia")) {

        String resultado = "";
        int id = Integer.parseInt(request.getParameter("id"));
        resultado = Noticia.getInstance().obtener(id);
        out.println(resultado);

    }

%>